package library.and.xps.com.step.util;

import java.util.ArrayList;
import java.util.List;

public class AppCommond {
    private int OPERATION = 0;//操作
    public static int CLOSE_ACTIVITY = 1;//命令
    private List<String> acNameList = new ArrayList<>();


    public void requestCloseActivity(String... toCloseAcName) {
        acNameList.clear();
        for (String name : toCloseAcName) {
            acNameList.add(name);
        }
    }

    public List<String> getAcNameList() {
        return acNameList;
    }

    public AppCommond() {
    }

    public int getOperation() {
        return OPERATION;
    }

    public void setOperation(int OPERATION) {
        this.OPERATION = OPERATION;
    }

    public static class Builder {
        AppCommond appCommond = null;

        public Builder() {
            appCommond = new AppCommond();
        }
        public Builder setOpration(int i){
            appCommond.setOperation(i);
            return this;
        }

        /**
         * 添加想要关闭的Activity.getSimpleName
         * */
        public Builder setRequestcloseAcname(String... name){
            appCommond.requestCloseActivity(name);
            return this;
        }
        public AppCommond build(){
            return appCommond;
        }
    }
}
